using System;
using System.IO;

using Dashboard;
using Dashboard.Util;

namespace Dashboard.Mint.Tiles
{
	[Tile (Type = "db:lastfm")]
	public class LastFmTile : Tile
	{
		public LastFmTile (Match match) : base (match)
		{
			Title = match.Properties.GetPropertyValue ("dc:title");

			int similarity = (int)Math.Round (Double.Parse (match.Properties.GetPropertyValue ("db:similarity")));
			Description = String.Format ("{0}% similarity",  similarity);
		}

		public override Gdk.Pixbuf GetIcon (int size)
		{
			return Util.LoadResourceIcon ("audioscrobbler.png", size);
		}
	}
}